Repository navigation
Conversation
ionite34
left a comment
There was a problem hiding this comment.
A few notes on Generators not being bound to functions, and fixing the inheritance explanation for Iterator -> Generator, instead of the other way around
|
This tag feels like it's trying to compare generators and iterators, which I don't think makes sense. Since a generator (function) returns an iterator, this feels a bit like comparing e.g. a BMW to a Car. Would two separate tags on the topics make more sense? |
|
Tags should be concise and answer a common question. If someone wants to know what a generator is, at a high-enough level that it can be answered concisely, I don't think many of the details here are relevant. I would rather see a tag that gives an example of a generator created through a function, and an explanation of how the generator maintains its own state between yields (but preferably without the word "state"). |
Well, maybe the wording in the file may lead you to think that its trying to compare an iterator and a generator, im not aiming to, im aiming to explain both concepts, if you have any suggestions especially about the wording, please let me know! |
ionite34
left a comment
There was a problem hiding this comment.
I feel like the proposed tag would be better focused on explanations of the creation of generators and generator expressions instead of custom Iterator classes, proposed a couple of changes in line with this.
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
|
Your understanding of Python's internals is impressive, but I feel that this tag focuses on the wrong details, and tags of this length are not likely to be read in their entirety. Consider the target audience (novice Python developers) and the context in which this is intended to be read (likely during a help session where said novice is focused mainly on solving a specific problem). As insightful as it is, I would like to see all discussion of classes and dunder methods removed. Perhaps you could instead demonstrate how a function that returns a list of X could be refactored to generate X. Remember: for a novice Python developer, what's remarkable about generators is that they "go to sleep" between iterations and "keep all variables", or some phrasing along those lines. |
ionite34
left a comment
There was a problem hiding this comment.
Reduced some details on generator internal states and classes to be more beginner-friendly.
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
|
@ionite34 well done especially on the implementation of examples! |
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Co-authored-by: Ionite <dev@ionite.io>
Pending someone to review this in relation to policy
|
For an additional note, the |
|
We discussed during today's staff meeting, we would like to see this tag revamped/pivoted to a narrower scope, which also leverages and links to the Real Python article on generators. Please let us know if you'd be interested in doing that @Okimii. We will also work on better defining what criteria we feel a tag should meet to best serve as a teaching tool for a real-time communication platform such as Discord, and also make it a bit clearer that a PR for a tag should not be opened without further discussion on a meta issue first. |
|
@minalike I wouldn't mind revamping the tag, I would love for the staff of pydis to make it better and more defined in the context of details for a better tag for beginners, I can also help with the structure of the tag but im not quite good with wording so I would really need help on that part, either way there's allot of talented people in pydis staff, e.g @ionite34 which has helped allot especially wording wise and the tags structure, so even if my wording isn't the best it can also be corrected which I do appreciate as it does help me. |
|
I'd like to see this shortened down dramatically.
|
|
I love that idea. |
Would love all the feedback!